package com.atguigu.gulimall.search.controller;

import com.atguigu.common.to.es.SkuEsMode;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.search.service.ProductSaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * @Author: Farewell
 * @Date: 2022/5/25 19:47
 * @Description:
 */
@RestController
@RequestMapping("/search/save")
public class ElasticSaveController {

    @Autowired
    private ProductSaveService productSaveService;

    /**
     * 上传商品信息
     */
    @PostMapping("/product")
    public R productStatusUp(@RequestBody List<SkuEsMode> skuEsModes) {
        productSaveService.productStatusUp(skuEsModes);
        return R.ok();
    }
}
